home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmNotePad
- Caption = "Untitled"
- ClientHeight = 3975
- ClientLeft = 600
- ClientTop = 2430
- ClientWidth = 5610
- Height = 4665
- Left = 540
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 3975
- ScaleWidth = 5610
- Top = 1800
- Visible = 0 'False
- Width = 5730
- Begin TextBox Text1
- Height = 3855
- HideSelection = 0 'False
- Left = 0
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 0
- Top = 0
- Width = 5655
- End
- Begin Menu mnuFile
- Caption = "&File"
- Begin Menu mnuFNew
- Caption = "&New"
- End
- Begin Menu mnuFOpen
- Caption = "&Open..."
- End
- Begin Menu mnuFClose
- Caption = "&Close"
- End
- Begin Menu mnuFSave
- Caption = "&Save"
- End
- Begin Menu mnuFSaveAs
- Caption = "Save &As..."
- End
- Begin Menu mnuFSep
- Caption = "-"
- End
- Begin Menu Print
- Caption = "&Print"
- End
- Begin Menu seper
- Caption = "-"
- End
- Begin Menu mnuFExit
- Caption = "E&xit"
- End
- Begin Menu mnuRecentFile
- Caption = "-"
- Index = 0
- Visible = 0 'False
- End
- Begin Menu mnuRecentFile
- Caption = "RecentFile1"
- Index = 1
- Visible = 0 'False
- End
- Begin Menu mnuRecentFile
- Caption = "RecentFile2"
- Index = 2
- Visible = 0 'False
- End
- Begin Menu mnuRecentFile
- Caption = "RecentFile3"
- Index = 3
- Visible = 0 'False
- End
- Begin Menu mnuRecentFile
- Caption = "RecentFile4"
- Index = 4
- Visible = 0 'False
- End
- End
- Begin Menu mnuEdit
- Caption = "&Edit"
- Begin Menu mnuECut
- Caption = "Cu&t"
- Shortcut = ^X
- End
- Begin Menu mnuECopy
- Caption = "&Copy"
- Shortcut = ^C
- End
- Begin Menu mnuEPaste
- Caption = "&Paste"
- Shortcut = ^V
- End
- Begin Menu mnuEDelete
- Caption = "De&lete"
- Shortcut = {DEL}
- End
- Begin Menu mnuESep1
- Caption = "-"
- End
- Begin Menu mnuESelectAll
- Caption = "Select &All"
- End
- Begin Menu mnuETime
- Caption = "Time/&Date"
- End
- End
- Begin Menu mnuSearch
- Caption = "&Search"
- Begin Menu mnuSFind
- Caption = "&Find"
- End
- Begin Menu mnuSFindNext
- Caption = "Find &Next"
- Shortcut = {F3}
- End
- End
- Begin Menu mnuOptions
- Caption = "&Options"
- Begin Menu mnuOToolbar
- Caption = "&Toolbar"
- End
- End
- Begin Menu mnuWindow
- Caption = "&Window"
- WindowList = -1 'True
- Begin Menu mnuWCascade
- Caption = "&Cascade"
- End
- Begin Menu mnuWTile
- Caption = "&Tile"
- End
- Begin Menu mnuWArrange
- Caption = "&Arrange Icons"
- End
- End
- Begin Menu VB
- Caption = "VB-Script"
- Begin Menu REG
- Caption = "REGULAR COMMANDS"
- End
- Begin Menu c
- Caption = "-"
- End
- Begin Menu VBSCRIPT
- Caption = "<SCRIPT LANGUAGE=""VBSCRIPT"">"
- End
- Begin Menu COMENCE
- Caption = "<!--"
- End
- Begin Menu ENDSCRIPT
- Caption = "-->"
- End
- Begin Menu FINALINE
- Caption = "</SCRIPT>"
- End
- Begin Menu SUB
- Caption = "SUB"
- End
- Begin Menu ENDSUB
- Caption = "END SUB"
- End
- Begin Menu BLANK
- Caption = "-"
- End
- Begin Menu main
- Caption = "&MAIN FUNCTIONS"
- Begin Menu function
- Caption = "Function"
- End
- Begin Menu ENDFUNCTION
- Caption = "End Function"
- End
- Begin Menu a
- Caption = "-"
- End
- Begin Menu InputMenu
- Caption = "Input menu"
- Begin Menu INPUTTYPE
- Caption = "<INPUT TYPE=""BUTTON"" "
- End
- Begin Menu SUBMIT
- Caption = "<INPUT TYPE=""SUBMIT"">"
- End
- Begin Menu RESET
- Caption = "<INPUT TYPE=""RESET"">"
- End
- End
- Begin Menu ifmenu
- Caption = "If Menu"
- Begin Menu if
- Caption = "If Then"
- End
- Begin Menu else
- Caption = "Else"
- End
- Begin Menu endif
- Caption = "endif"
- End
- End
- Begin Menu LOOPS
- Caption = "&LOOPS"
- Begin Menu FOR
- Caption = "FOR NEXT LOOP"
- End
- Begin Menu dountil
- Caption = "Do-Until"
- End
- Begin Menu dotilloop
- Caption = "Do-Until Loop"
- End
- Begin Menu dowhile
- Caption = "Do-While"
- End
- Begin Menu dowhileloop
- Caption = "Do-While Loop"
- End
- End
- End
- End
- Begin Menu Help
- Caption = "Help"
- Begin Menu hfile
- Caption = "Help File"
- End
- Begin Menu techsupport
- Caption = "Obtaining Technical Support"
- End
- Begin Menu about
- Caption = "About DSG VB-Script Pad"
- End
- End
- Sub about_Click ()
- form2.Show
- End Sub
- Sub COMENCE_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "<!--"
- frmMDI.ActiveForm.ActiveControl.SelText = ""
- End Sub
- Sub dotilloop_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "Do Until Loop"
- End Sub
- Sub dountil_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "Do Until"
- End Sub
- Sub dowhile_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "Do While"
- End Sub
- Sub dowhileloop_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "Do While Loop"
- End Sub
- Sub else_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "else"
- End Sub
- Sub ENDFUNCTION_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "End Function"
- End Sub
- Sub endif_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "End If"
- End Sub
- Sub ENDSCRIPT_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "-->"
- frmMDI.ActiveForm.ActiveControl.SelText = ""
- End Sub
- Sub ENDSUB_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "End Sub"
- End Sub
- Sub FINALINE_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "</SCRIPT>"
- End Sub
- Sub FOR_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "For Next"
- End Sub
- Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
- Dim Msg, Filename, NL
- Dim Response As Integer
- If FState(Me.Tag).Dirty Then
- Filename = Me.Caption
- NL = Chr$(10) & Chr$(13)
- Msg = "The text in [" & Filename & "] has changed."
- Msg = Msg & NL
- Msg = Msg & "Do you want to save the changes?"
- Response = MsgBox(Msg, 51, frmMDI.Caption)
- Select Case Response
- ' User selects Yes
- Case 6
- 'Get the filename to save the file
- Filename = GetFileName()
- 'If the user did notspecify a file name,
- 'cancel the unload; otherwise, save it.
- If Filename = "" Then
- Cancel = True
- Else
- SaveFileAs (Filename)
- End If
- ' User selects No
- ' Ok to unload
- Case 7
- Cancel = False
- ' User selects Cancel
- ' Cancel the unload
- Case 2
- Cancel = True
- End Select
- End If
- End Sub
- Sub Form_Resize ()
- If windowstate <> 1 And ScaleHeight <> 0 Then
- text1.Visible = False
- text1.Height = ScaleHeight
- text1.Width = ScaleWidth
- text1.Visible = True
- End If
- End Sub
- Sub Form_Unload (Cancel As Integer)
- FState(Me.Tag).Deleted = True
- 'Hide toolbar edit buttons if no notepad windows
- If Not AnyPadsLeft() Then
- frmMDI!imgCutButton.Visible = False
- frmMDI!imgCopyButton.Visible = False
- frmMDI!imgPasteButton.Visible = False
- End If
- End Sub
- Sub function_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "Function"
- End Sub
- Sub hfile_Click ()
- form1.Show
- End Sub
- Sub if_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "If Then"
- End Sub
- Sub INPUTTYPE_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "<INPUT TYPE=" + Chr(34) + "Button" + Chr(34) + " NAME=Button1" + " VALUE=" + Chr(34) + " Button1" + Chr(34) + ">"
- End Sub
- Sub mnuECopy_Click ()
- EditCopyProc
- End Sub
- Sub mnuECut_Click ()
- EditCutProc
- End Sub
- Sub mnuEDelete_Click ()
- ' If cursor is not at the end of the notepad.
- If screen.ActiveControl.SelStart <> Len(screen.ActiveControl.Text) Then
- ' If nothing is selected, extend selection by one.
- If screen.ActiveControl.SelLength = 0 Then
- screen.ActiveControl.SelLength = 1
- ' If cursor is on a blank line, extend selection by two.
- If Asc(screen.ActiveControl.SelText) = 13 Then
- screen.ActiveControl.SelLength = 2
- End If
- End If
- ' Delete selected text.
- screen.ActiveControl.SelText = ""
- End If
- End Sub
- Sub mnuEPaste_Click ()
- EditPasteProc
- End Sub
- Sub mnuESelectAll_Click ()
- frmMDI.ActiveForm.text1.SelStart = 0
- frmMDI.ActiveForm.text1.SelLength = Len(frmMDI.ActiveForm.text1.Text)
- End Sub
- Sub mnuETime_Click ()
- Dim TimeStr As String, DateStr As String
- text1.SelText = Now
- End Sub
- Sub mnuFClose_Click ()
- Unload Me
- End Sub
- Sub mnuFExit_Click ()
- ' Unloading the MDI form invokes the QueryUnload event
- ' for each child form, then the MDI form - before unloading
- ' the MDI form. Setting the Cancel argument to True in any of the
- ' QueryUnload events aborts the unload.
- Unload frmMDI
- End Sub
- Sub mnuFNew_Click ()
- FileNew
- End Sub
- Sub mnuFontName_Click (index As Integer)
- End Sub
- Sub mnuFOpen_Click ()
- FOpenProc
- End Sub
- Sub mnuFSave_Click ()
- Dim Filename As String
- If Left(Me.Caption, 8) = "Untitled" Then
- ' The file hasn't been saved yet,
- ' get the filename, then call the
- ' save procedure
- Filename = GetFileName()
- Else
- ' The caption contains the name of the open file
- Filename = Me.Caption
- End If
- ' call the save procedure, if Filename = Empty then
- ' the user selected Cancel in the Save As dialog, otherwise
- ' save the file
- If Filename <> "" Then
- SaveFileAs Filename
- End If
- End Sub
- Sub mnuFSaveAs_Click ()
- Dim SaveFileName As String
- SaveFileName = GetFileName()
- If SaveFileName <> "" Then SaveFileAs (SaveFileName)
- ' Update the recent files menu
- UpdateFileMenu (SaveFileName)
- End Sub
- Sub mnuOptions_Click ()
- mnuOToolbar.Checked = frmMDI!picToolbar.Visible
- End Sub
- Sub mnuOToolbar_Click ()
- OptionsToolbarProc Me
- End Sub
- Sub mnuRecentFile_Click (index As Integer)
- OpenFile (mnuRecentFile(index).Caption)
- ' Update recent files list for new notepad.
- GetRecentFiles
- End Sub
- Sub mnuSFind_Click ()
- If Me!text1.SelText <> "" Then
- frmFind!text1.Text = Me!text1.SelText
- Else
- frmFind!text1.Text = FindString
- End If
- gFirstTime = True
- frmFind.Show
- End Sub
- Sub mnuSFindNext_Click ()
- If Len(gFindString) > 0 Then
- FindIt
- Else
- mnuSFind_Click
- End If
- End Sub
- Sub mnuWArrange_Click ()
- frmMDI.Arrange ARRANGE_ICONS
- End Sub
- Sub mnuWCascade_Click ()
- frmMDI.Arrange CASCADE
- End Sub
- Sub mnuWTile_Click ()
- frmMDI.Arrange TILE_HORIZONTAL
- End Sub
- Sub Print_Click ()
- printer.Print text1.Text
- printer.EndDoc
- End Sub
- Sub RESET_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "<INPUT TYPE=" + Chr(34) + "Reset" + Chr(34) + ">"
- End Sub
- Sub SUB_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "Sub "
- End Sub
- Sub SUBMIT_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = "<INPUT TYPE=" + Chr(34) + "Submit" + Chr(34) + ">"
- End Sub
- Sub techsupport_Click ()
- MsgBox "FOR TECHNICAL SUPPORT E-MAIL DSG@HOTBOT.COM"
- End Sub
- Sub Text1_Change ()
- FState(Me.Tag).Dirty = True
- End Sub
- Sub Text1_GotFocus ()
- If frmFind.Visible Then
- frmFind.ZOrder 0
- End If
- End Sub
- Sub VBSCRIPT_Click ()
- frmMDI.ActiveForm.ActiveControl.SelText = " <SCRIPT LANGUAGE=" + Chr(34) + "VBSCRIPT" + Chr(34) + "> "
- frmMDI.ActiveForm.ActiveControl.SelText = ""
- End Sub
-